import MP4Box from 'mp4box';

const getMimeType = (buffer) => {
    return new Promise((resolve, reject) => {
        const mp4boxfile = MP4Box.createFile();

        mp4boxfile.onReady = (info) => resolve(info.mime);
        mp4boxfile.onError = () => reject();

        buffer.fileStart = 0;
        mp4boxfile.appendBuffer(buffer);
    });
}
export default getMimeType